package com.lb.activiti.spring;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.repository.ProcessDefinition;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * spring和activiti整合
 */
public class SpringActivitiTest {
    public static void main(){
        ApplicationContext context = new ClassPathXmlApplicationContext(
                "com/lb/activiti/spring/applicationContext.xml"
        );
        ProcessEngine processEngine = (ProcessEngine) context.getBean("processEngine");
        List<ProcessDefinition> list =
                processEngine.getRepositoryService().createProcessDefinitionQuery().list();
        for (ProcessDefinition processDefinition : list) {
            System.out.println(processDefinition.getId());
        }
    }
}
